<!DOCTYPE html>
<html lang="en">

    <head>
        <meta charset="UTF-8">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <meta http-equiv="X-UA-Compatible" content="ie=edge">
        <title>Document</title>
    </head>

    <body>
        <div>promise测试</div>
        <script type="text/javascript">
            /*
                  var backUrl = 'http://qiaodev.natapp4.cc/wx_test/openid.php?url=http://qiaodev.natapp4.cc/wx_test/test1.html';
                  window.location.href =
                    "https://open.weixin.qq.com/connect/oauth2/authorize?appid=wx8ad440a19b0a4556&redirect_uri=" + backUrl +
                    "&response_type=code&scope=snsapi_userinfo&state=123#wechat_redirect";
             */
            var p=new Promise(function(resolve,reject){
                setTimeout(function() {
                    resolve('data come back..');
                }, 2000);
            })
            p.then(function(rtn){
                alert(rtn);
            }).catch(function(err){
                alert(err);
            })
        </script>
    </body>

</html>
